package com.dangdi.show.dao;

import com.gexin.fastjson.serializer.MapSerializer;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ShiroDao {
    //查看所有管理员
    @Select("select * from manager")
    List<Map> FindAllManagerList();

    //按照管理手机号称获取角色
    @Select("select role_name from role,manager where manager.manager_id=role.manager_id and manager_tel=#{manager_tel}")
    Set<String> FindManagerRoleByManagerTel(@Param("manager_tel") String manager_tel);

    //按照管理员手机号获取权限
    @Select("select permissions_name from manager,role,permissions where manager.manager_id=role.manager_id and permissions.role_name=role.role_name and manager.manager_tel=#{manager_tel}")
    Set<String> FindManagerPermissionsByManagerTel(@Param("manager_tel") String manager_tel);

    //按照手机号获取管理员信息
    @Select("select * from manager where manager_tel=#{manager_tel}")
    Map<String, Object> FindManagerByManagerTel(@Param("manager_tel") String manager_tel);

    //按照手机号获取管理员信息
    @Select("select * from wechat_user where open_id=#{open_id}")
    String FindWechatUserByOpenId(@Param("open_id") String open_id);

}
